from django.core.management.base import BaseCommand, CommandError
from condition_order.services.condition_order_logic import recover_condition_order


class Command(BaseCommand):
    def handle(self, *args, **options):
        cots = recover_condition_order()
        if cots:
            for cot in cots:
                cot.join()
            cot.stop_pub()

